<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" import="com.zzty.springmybatis.entity.User"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<meta charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ZZTY</title>
<!-- BOOTSTRAP STYLES-->
<!-- <link href="../css/bootstrap-datetimepicker.css" rel="stylesheet" /> -->
<!-- CUSTOM STYLES-->

<link rel="stylesheet"
	href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script
	src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>



<link href="/SpringMVCMybatis/css/bootstrap-datetimepicker.css"
	rel="stylesheet" />
<link href="/SpringMVCMybatis/css/bootstrap.css" rel="stylesheet" />
<link href="/SpringMVCMybatis/css/bootstrap.min.css" rel="stylesheet" />
<link href="/SpringMVCMybatis/css/custom.css" rel="stylesheet" />



<script src="http://code.jquery.com/jquery-latest.js"></script>

<script type="text/javascript">
<%-- <%User user = (User) request.getSession().getAttribute("user"); --%>
<%-- 			String img = (String) user.getImg();%> --%>
	$(document).ready(function() {
// 		$("#searchbydate").click(function() {
// 			alert($("#date").val());
// 			$("#tablebody").empty();

			$.ajax({
				type : "POST",
				url : "selfgread/Call",
				// 				dataType : "json",
				contentType : "application/json",
				data : JSON.stringify({
// 					date : $("#date").val()
				}),
				success : function(data) {
						var obj = JSON.parse(data);
		 				for (i in obj) {
		 					var x = "<tr>";
		 						x = x + "<td>" + obj[i].userId + "</td><td> "+ obj[i].date+"</td><td>" + obj[i].stuName + "</td><td>" + obj[i].totalTime + "</td><td>" + obj[i].score + "</td>";
		 						x = x + "<td><button class = 'details' >详情</button></td></tr>";
		 					$("#tablebody").append(x);
		 				}
// 		 				$("#tarea1").val( obj[0].question);
				},
				error : function(data) {
					alert("查询失败");
				}
			});
			
// 		})
		
		$(document).on("click",".details",function(){
// 			var date = $("#date").val();
			var date = $(this).parent().parent().children().eq(1).html();
			var id = $(this).parent().parent().children().eq(0).html();
			window.open("StudentAnswer.jsp?id=" + id + "&date=" + date + "&operation=selfExam");
// 			window.open("https://www.baidu.com/");
		})
	})

</script>

<body>
	<div id="wrapper">
		<nav class="navbar navbar-default navbar-cls-top " role="navigation"
			style="margin-bottom: 0">
			<div class="navbar-header">
				<!--                 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse"> -->
				<!--                     <span class="sr-only">Toggle navigation</span> -->
				<!--                     <span class="icon-bar"></span> -->
				<!--                     <span class="icon-bar"></span> -->
				<!--                     <span class="icon-bar"></span> -->
				<!--                 </button> -->
				<a class="navbar-brand">自在天原</a>
			</div>
			<div
				style="color: white; padding: 15px 50px 5px 50px; float: right; font-size: 16px;">
				<form action="../loginOut.jsp" method="post">
					<button type="submit" class="btn btn-danger">注销</ button>







					
				</form>
			</div>
		</nav>
		<!-- /. NAV TOP  -->
		<nav class="navbar-default navbar-side" role="navigation">
			<div class="sidebar-collapse">
				<ul class="nav" id="main-menu">
					<li class="text-center"><img src=" "
						class="user-image img-responsive" /></li>


					<!-- 					<li><a href="../index.jsp"><i -->
					<!-- 							class="fa fa-dashboard fa-3x"></i> 主页</a></li> -->
					<!-- 					<li><a href="UserInfo.jsp"><i class="fa fa-table fa-3x"></i> -->
					<!-- 							个人信息</a></li> -->
						<li><a href="../SpringMVCMybatis/selfgread"><i
							class="fa fa-desktop fa-3x"></i> 竞赛批改</a></li>
					<li><a href="../SpringMVCMybatis/teamgread"><i class="fa fa-qrcode fa-3x"></i>
							结对批改</a></li>
					<li><a href="../SpringMVCMybatis/que/AssginTask"><i
							class="fa fa-bar-chart-o fa-3x"></i> 竞赛布置</a></li>
					<li><a href="../SpringMVCMybatis/group/group"><i
							class="fa fa-bar-chart-o fa-3x"></i> 结对分组</a></li>
					<li><a href="../SpringMVCMybatis/SearchScore/toSearch"><i
							class="fa fa-bar-chart-o fa-3x"></i> 学生成绩</a></li>
					<li><a href="../SpringMVCMybatis/Data"><i
							class="fa fa-bar-chart-o fa-3x"></i> 数据库查询</a></li>
					<!-- 					<li><a href="ChangePassword.jsp"><i -->
					<!-- 							class="fa fa-edit fa-3x"></i> 密码修改 </a></li> -->


				</ul>

			</div>

		</nav>
		<!-- /. NAV SIDE  -->
		<div id="page-wrapper">
			<div id="page-inner">
				<div class="row">
					<div class="col-md-12">
						<h2>个人竞赛作业批改</h2>
						<h5></h5>
<!-- 						<p> -->
<!--  		日期：<input type="date" id="date" />  -->
<!-- 							<input type="button" id="searchbydate" value="查找" /> -->
<!-- 						</p> -->


						<div class="row" style="padding: 50px 20px 0px 20px">
<!-- 							<textarea id="tarea1" rows="15" cols="100" -->
<!-- 								style="background: transparent"></textarea> -->
							<div class="table-responsive">
								<table class="table table-striped" id="table1"
									style="text-align: center">
									<thead>
										<tr>
											<th style="text-align: center">ID</th>
											<th style="text-align: center">Date</th>
											<th style="text-align: center">姓名</th>
											<th style="text-align: center">用时(min)</th>
											<th style="text-align: center">评分</th>
											<th style="text-align: center">进行评价</th>

										</tr>
									</thead>
									<tbody id="tablebody"></tbody>
								</table>

								<div></div>
							</div>
							<!-- 							<div class="col-sm-offset-5 col-sm-7"> -->
							<!-- 								<button class="btn btn-primary" onclick="setRank()">生成结果</button> -->
							<!-- 							</div> -->
						</div>
					</div>

				</div>
			</div>
			<!-- /. PAGE INNER  -->
		</div>


		<!-- /. PAGE WRAPPER  -->
	</div>
</body>
</html>
